<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /**
        * @param {number[]} nums
        * @return {void} Do not return anything, modify nums in-place instead.
        */
        var moveZeroes = function (nums) {
            let left=0;
            let i = 0
            while(left<nums.length){
                if(nums[left]==0){
                    left++
                }else{
                    nums[i++] = nums[left++]
                }
            }
            for (i;i<nums.length;i++) nums[i] = 0
            return nums
        };
        console.log(moveZeroes([0,1,0,3,12]))
    </script>
</body>

</html>